package com.ptv.database;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleCursorAdapter;

public class AlumnosCursorAdapter extends SimpleCursorAdapter{

	private static final String CAMPO_TELEFONO = "telefono";
	
	public AlumnosCursorAdapter(Context context, int layout, Cursor c,
			String[] from, int[] to) {
		super(context, layout, c, from, to);
	}

    private void setViewTag(View view, Object tag) { 
         view.setTag(tag); 
         if (view instanceof ViewGroup) { 
             for (int i=0; i < ((ViewGroup) view).getChildCount(); i++) { 
                 setViewTag(((ViewGroup) view).getChildAt(i), tag); 
             }
         } 
     }
    
    @Override
    public void bindView(View view, Context context, Cursor cursor) {
    	super.bindView(view, context, cursor);

        setViewTag(view, cursor.getString(cursor.getColumnIndex(CAMPO_TELEFONO))); 
    }
}
